/**
 * 全局动画样式
 * 提供统一的动画效果和过渡效果
 */

/* ========== 淡入动画 ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn var(--duration-normal, 0.3s) ease-in;
}

.fade-in-fast {
  animation: fadeIn var(--duration-fast, 0.2s) ease-in;
}

.fade-in-slow {
  animation: fadeIn var(--duration-slow, 0.5s) ease-in;
}

/* ========== 淡出动画 ========== */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.fade-out {
  animation: fadeOut var(--duration-normal, 0.3s) ease-out;
}

/* ========== 滑入动画 ========== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-up {
  animation: slideInUp var(--duration-normal, 0.3s) ease-out;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-down {
  animation: slideInDown var(--duration-normal, 0.3s) ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft var(--duration-normal, 0.3s) ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight var(--duration-normal, 0.3s) ease-out;
}

/* ========== 缩放动画 ========== */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn var(--duration-normal, 0.3s) ease-out;
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.scale-out {
  animation: scaleOut var(--duration-normal, 0.3s) ease-in;
}

/* ========== 旋转动画 ========== */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate {
  animation: rotate 1s linear infinite;
}

.rotate-slow {
  animation: rotate 2s linear infinite;
}

/* ========== 脉冲动画 ========== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ========== 弹跳动画 ========== */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.bounce {
  animation: bounce 1s ease-in-out infinite;
}

/* ========== 摇摆动画 ========== */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* ========== 闪烁动画 ========== */
@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.blink {
  animation: blink 1s ease-in-out infinite;
}

/* ========== 浮动动画 ========== */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ========== 渐变动画 ========== */
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-animation {
  background-size: 200% 200%;
  animation: gradient 3s ease infinite;
}

/* ========== 过渡效果 ========== */
.transition-all {
  transition: all var(--duration-normal, 0.3s) ease;
}

.transition-fast {
  transition: all var(--duration-fast, 0.2s) ease;
}

.transition-slow {
  transition: all var(--duration-slow, 0.5s) ease;
}

.transition-transform {
  transition: transform var(--duration-normal, 0.3s) ease;
}

.transition-opacity {
  transition: opacity var(--duration-normal, 0.3s) ease;
}

.transition-colors {
  transition: color var(--duration-normal, 0.3s) ease,
              background-color var(--duration-normal, 0.3s) ease,
              border-color var(--duration-normal, 0.3s) ease;
}

/* ========== 悬停效果 ========== */
.hover-lift {
  transition: transform var(--duration-normal, 0.3s) ease,
              box-shadow var(--duration-normal, 0.3s) ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(200, 16, 46, 0.16));
}

.hover-scale {
  transition: transform var(--duration-normal, 0.3s) ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow var(--duration-normal, 0.3s) ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(200, 16, 46, 0.4);
}

/* ========== 响应式动画 ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== 打印时禁用动画 ========== */
@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}


